<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="MySQL.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户信息保存</title>
</head>
<body>
	<%
		//request.setCharacterEncoding("UTF-8");
		String userId[] = request.getParameterValues("selectUser");
		int resultNum = 0;
		String str = "";
		if (userId != null) {
			for (int i = 0; i < userId.length; i++) {
				str = str + "'" + userId[i] + "',";
			}
			str = str.substring(0, str.length() - 1);

			String sql = "delete from tempUser where user_id in (" + str + ")" ;
			
			try {
				resultNum = stmt.executeUpdate(sql);
			} catch (SQLException e) {
				out.println("错误提示：" + e.getMessage());
			} finally {
				stmt.close();
				conn.close();
			}
		}

		if (resultNum > 0) {
			out.println("恭喜您，成功删除" + resultNum + "条用户信息。");
			response.setHeader("Refresh", "2;URL=d2018.3.27_dataList.jsp");
		} else {
			out.println("抱歉，用户信息删除失败。");
		}
	%>
</body>
</html>